package com.atguigu.yygh.sms.controller;

import com.atguigu.yygh.result.R;
import com.atguigu.yygh.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/3/20 1:44
 */
@RestController
@RequestMapping("/api/sms")
public class SmsController {
    @Autowired
    private SmsService smsService;
    @GetMapping("/send/{phone}")
    public R sendSms(@PathVariable("phone") String phone) {
        Boolean flag=smsService.sendSms(phone);
        if(flag){
            return R.ok();
        }else {
            return R.error();
        }
    }
}
